const path = require("path");
const { merge } = require("webpack-merge");
const common = require("./webpack.common.config");
const webpack = require("webpack");
module.exports = merge(common, {
  mode: "development",
  // 内联调试方便
  devtool: "inline-source-map",
  devServer: {
    contentBase: "./dist",
    hot: true
  },
  output: {
    filename: "[name].[chunkhash:8].js",
    path: path.resolve(__dirname, "dist"),
    clean: true,
    publicPath: "/"
  },
  plugins: [
    new webpack.EnvironmentPlugin({
      NODE_ENV: "development", // 使用 'development' ，除非 process.env.NODE_ENV 被定义
      DEBUG: false
    })
  ]
});
